#ifndef _SAMPLE_H_
#define _SAMPLE_H_

#include "../d_Math/d_Math.h"

using namespace d_Math;

// ==================================================================
// A helper class for super-sampling.  The position specifies the 2D
// offset within the pixel from (0,0) -> (1,1).

class Sample {

public:

  // CONSTRUCTOR & DESTRUCTOR
  Sample () { 
    position = d_Vec2f(0.5, 0.5);
    color = d_Vec3f(0,0,0); }
  ~Sample () {}

  // ACCESSORS
  d_Vec2f getPosition() { return position; }
  d_Vec3f getColor() { return color; }

  // MODIFIERS
  void set(d_Vec2f p, d_Vec3f c) { 
    assert (p[0] >= 0 && p[0] <= 1);
    assert (p[1] >= 0 && p[1] <= 1);
    position = p;
    color = c; }

private:

  // REPRESENTATION
  d_Vec2f position;
  d_Vec3f color;

};

// ==================================================================

#endif

